import fly from '../../utils/fly.js'
/**
 *查询当前会员地址列表
 */
export function getAddrList() {
	return fly.get({
		url: `/applet/member/addr/addresses`,
		needToken: true
	})
}
/**
 *查询当前会员地址列表
 */
export function addAddr(params) {
	return fly.request({
		url: `/applet/member/addr/address`,
		needToken: true,
		method:'POST',
		params:params
	})
}

/**
 *查询当前会员的某个地址
 */
export function getAddr(id) {
	return fly.get({
		url: '/applet/member/addr/address/'+id,
		needToken: true
	})
}
/**
 * 设置地址为默认
 */
export function setDefaultAddr(id) {
	return fly.request({
		url: '/applet/member/addr/address/'+id+'/default',
		needToken: true,
		method:'PUT'
	})
}
/**
 * 修改会员地址
 */
export function updateAddr(id,params) {
	return fly.request({
		url: '/applet/member/addr/address/'+id,
		needToken: true,
		method:'PUT',
		params:params
	})
}
/**
 * 删除会员地址
 */
export function deleteAddr(id) {
	return fly.request({
		url: '/applet/member/addr/address/'+id,
		needToken: true,
		method:'DELETE'
	})
}
/**
 *地区
 */
export function getArea(id) {
	return fly.request({
		url: '/base/regions/'+id+'/children',
		needToken: false,
		method:'get'
	})
}